/**
 * Project Name:demo <br/>
 * File Name:MonProcessHandler.java <br/>
 * Package Name:com.ftu.srv.demo.service <br/>
 */
package com.ftu.srv.demo.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * <p>  </p>
 * @version 1.0 2018年12月27日 mq 
 */
public abstract class AbstractProcessHandler {
    private static final Logger logger = LoggerFactory.getLogger(AbstractProcessHandler.class);
    
    public String handler(String str) {
        beforeProcess(str);
        String st = process(str);
        if(doCustomLogic()) {
            customLogic();
        }
        afterProcess(str);
        return st;
    }
    private String beforeProcess(String str) {
        logger.info("before");
        return "before";
    }
    public abstract String process(String str);
    private String afterProcess(String str) {
        logger.info("after");
        return "after";
    }
    
    public boolean doCustomLogic() {
        return false;
    }
    public void customLogic() {
    }

}
